<template>
	<div>
		<el-table
			ref="tables"
			v-loading="searchLoading"
			border
			size="mini"
			show-summary
			:data="tableData"
			style="width: 100%"
			class="small-size-table"
			:header-cell-style="getRowClass"
			:max-height="tableHeight"
			element-loading-spinner="el-icon-loading"
			highlight-current-row
			:summary-method="(val) => handleRow(val, subSummary, totalSummary)"
		>
			<el-table-column
				prop="orderNo"
				align="center"
				:label="$t('funds.order_no')"
				min-width="280"
				fixed
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<Copy :title="scope.row.orderNo" :copy="copy">
						{{ scope.row.orderNo }}
					</Copy>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.fund_audit.commission_settlement_period')
					]
				"
				prop="reportYm"
				align="center"
				:label="$t('funds.fund_audit.commission_settlement_period')"
				width="180"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.cycleName }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.client_state')
					]
				"
				prop="payoutStatus"
				align="center"
				:label="$t('funds.proxy_member_funds_record.client_state')"
				min-width="160"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ getTypeName(scope.row.payoutStatus, allPayoutStatus) }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.proxy_name')]"
				prop="proxyName"
				align="center"
				:label="$t('funds.proxy_name')"
				min-width="130"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<Copy :title="scope.row.proxyName" :copy="copy">
						{{ scope.row.proxyName }}
					</Copy>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('common.belong_merchant')]"
				prop="merchantName"
				align="center"
				:label="$t('common.belong_merchant')"
				min-width="160"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.merchantName }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.capital_adjustment.proxy_level_id')
					]
				"
				align="center"
				:label="$t('funds.capital_adjustment.proxy_level_id')"
				prop="proxyLevel"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.proxyLevel }}
				</template>
			</el-table-column>
			<!-- <el-table-column
							v-if="
								tableColumnData[
									$t(
										'funds.capital_adjustment.parent_proxy_account'
									)
								]
							"
							prop="parentProxyName"
							align="center"
							:label="
								$t(
									'funds.capital_adjustment.parent_proxy_account'
								)
							"
							width="130"
							show-overflow-tooltip
						>
							<template slot-scope="scope">
								{{ scope.row.parentProxyName || '-' }}
							</template>
						</el-table-column> -->
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.account_status')
					]
				"
				prop="accountStatus"
				align="center"
				:label="$t('funds.proxy_member_funds_record.account_status')"
				min-width="150"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span
						v-if="scope.row.loginLockStatus === 1"
						class="disableRgba"
					>
						{{ $t('common.login_lock_status') }}
					</span>
					<span
						v-if="scope.row.paymentLockStatus === 1"
						class="deleteRgba"
					>
						{{ $t('common.account_lock_status') }}
					</span>
					<span
						v-if="
							scope.row.loginLockStatus === 0 &&
								scope.row.paymentLockStatus === 0
						"
						class="normalRgba"
					>
						{{ $t('common.account_status_normal') }}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.wind_control_level')]"
				prop="windControlName"
				align="center"
				:label="$t('funds.wind_control_level')"
				width="130"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.windControlName || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.fund_audit.adjust_team_commission')
					]
				"
				prop="commissionAmount"
				align="center"
				:label="`${$t('funds.fund_audit.adjust_team_commission')}`"
				width="180"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span>
						{{
							handleNumber(
								scope.row.currency,
								scope.row.commissionAdjustAmount +
									scope.row.commissionAmount
							)
						}}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.fund_audit.commission_adjust')]"
				prop="commissionAdjustAmount"
				align="center"
				:label="`${$t('funds.fund_audit.commission_adjust')}`"
				width="180"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span>
						{{
							handleNumber(
								scope.row.currency,
								scope.row.commissionAdjustAmount
							)
						}}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('funds.fund_audit.team_commission')]"
				prop="commissionAmount"
				align="center"
				:label="`${$t('funds.fund_audit.team_commission')}`"
				width="180"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span>
						{{
							handleNumber(
								scope.row.currency,
								scope.row.commissionAmount
							)
						}}
					</span>
				</template>
			</el-table-column>
			<el-table-column
				v-if="
					tableColumnData[
						$t('funds.proxy_member_funds_record.issue_time')
					]
				"
				align="center"
				:label="$t('funds.proxy_member_funds_record.issue_time')"
				min-width="180"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					{{ scope.row.audit2Time || '-' }}
				</template>
			</el-table-column>
			<el-table-column
				v-if="tableColumnData[$t('common.remark')]"
				align="center"
				:label="$t('common.remark')"
				min-width="220"
				show-overflow-tooltip
			>
				<template slot-scope="scope">
					<span v-if="scope.row.audit1Desc">
						一审: {{ scope.row.audit1Desc }}
					</span>
					<span v-if="scope.row.audit2Desc">
						<br />
						二审: {{ scope.row.audit2Desc }}
					</span>
					<span v-if="!scope.row.audit1Desc && !scope.row.audit2Desc">
						-
					</span>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
import list from '@/mixins/list'
import summaryList from './summaryList'
export default {
	mixins: [list, summaryList],
	props: {
		tableHeight: {
			type: Number,
			default: 480
		},
		searchLoading: {
			type: Boolean,
			default: false
		},
		tableData: {
			type: Array,
			default: () => {}
		},
		subSummary: {
			type: Object,
			default: () => {}
		},
		totalSummary: {
			type: Object,
			default: () => {}
		},
		allPayoutStatus: {
			type: Array,
			default: () => {}
		},
		activityList: {
			type: Object,
			default: () => {}
		}
	},
	data() {
		return {}
	},
	created() {
		this.initIndexDB('listTopProxyList', this.activityList)
	}
}
</script>
